package student.mindmap.gui;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.text.Font;
import javafx.stage.Stage;

import java.io.IOException;
import java.util.Objects;

public class Mind extends Application {
    @Override
    public void start(Stage primaryStage) throws IOException {
        // 从类路径根目录加载，路径以 / 开头表示从类路径根（即 resources 目录）查找
        FXMLLoader fxmlLoader = new FXMLLoader(Mind.class.getResource("/BorderPane.fxml"));
        if (fxmlLoader.getLocation() == null) {
            throw new IOException("FXML 文件未找到：/BorderPane.fxml");
        }
        Scene scene = new Scene(fxmlLoader.load(), 1200, 800);
        scene.getStylesheets().add(
                Objects.requireNonNull(getClass().getResource("/mindmap.css")).toExternalForm()
        );
        primaryStage.setTitle("思维导图");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch();
    }

}

